package net.ib.mtalk.database.task;

import net.ib.mtalk.ui.attachment.vcard.ContactAccessor;
import net.ib.mtalk.ui.attachment.vcard.ContactStruct;
import android.content.Context;
import android.net.Uri;
import android.os.Handler;

public class DBLoadContactTask extends AsyncClientTask{
	
	Uri mContactUri;
	Context mContext;
	ContactAccessor mContactAccessor;
	protected ContactStruct mContactStruct;
	
	public DBLoadContactTask(Context context, Handler uiHandler, 
			ContactAccessor contactAccessor, Uri contactUri) {
		super(context, uiHandler);
		mContactUri	= contactUri;
		mContext = context;
		mContactAccessor = contactAccessor;
	}
	
	@Override
	protected void onPostExecute(int resultCode, Object sentObject,
			Object receivedObject) {
		mContactStruct = mContactAccessor.loadContact(mContext.getContentResolver(), mContactUri);
	}
}
